<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    function isZhi(n) {
      if (n===1) {
        return '不是质数也不是和数'
      }
      var a = true;
      for (var i=2; i<n; i++) {
        if (n%i === 0) {
          a = false;
          break;
        }
      }
      return a;
    }
    console.log(isZhi(4));
  </script>
</body>
</html>